Problem: Assume that $S$ is an inwardly oriented, piecewise-smooth surface with a piecewise-smooth, simple, closed boundary curve $C$ oriented negatively with respect to the orientation of $S$. $ \iint_S \left[ 4z \hat{\imath} + (x - \cos(z)) \hat{\jmath} + 2 \hat{k} \right] \cdot dS$ Use Stokes' theorem to rewrite the surface integral as a line integral. Leave out extraneous functions of $z$ and constant coefficients. $ \oint_C ((2y) \hat{\imath} + (2z^2) \hat{\jmath} + $ $ \hat{k} ) \cdot dr$
Explanation: Assume we have a continuously differentiable three-dimensional vector field $F(x, y, z)$, an oriented piecewise-smooth surface $S$, and a piecewise-smooth, simple, closed boundary curve $C$ oriented positively with respect to $S$. Then Stokes' theorem states that we have the equality below: $ \oint_C F \cdot dr = \iint_S \text{curl}(F) \cdot dS$ If $C$ is negatively oriented, the line integral is equal to the negative of the double integral. [What does any of that mean?] When we use Stokes' theorem to translate from surface integrals to line integrals, we know $\text{curl}(F)$ and we want to find $F$. In general, this inverse curl operation is difficult and sometimes impossible to perform, but in this case we only have one value to find. Specifically: $F(x, y, z) = (2y) \hat{\imath} + (2z^2) \hat{\jmath} + ( ??? ) \hat{k}$ Because $C$ is negatively oriented, we want $\text{curl}(F)$ to equal the negative of what's inside the double integral. Therefore, our task is to find what $z$ -component gives $F$ the special property: $\text{curl}(F) = (-4z) \hat{\imath} + (\cos(z) - x) \hat{\jmath} - 2 \hat{k}$ Let's give a name to the $z$ -component of $F$, say $P$. The only constraint we have on $P$ is that it must make $F$ have the correct curl. $\begin{aligned} \text{curl}(F) &= \det \begin{pmatrix} \hat{\imath} & \hat{\jmath} & \hat{k} \\ \\ \dfrac{\partial}{\partial x} & \dfrac{\partial}{\partial y} & \dfrac{\partial}{\partial z} \\ \\ 2y & 2z^2 & P \end{pmatrix} \\ \\ &= \left( \dfrac{\partial P}{\partial y} - 4z \right) \hat{\imath} \\ \\ &+ \left( -\dfrac{\partial P}{\partial x} \right) \hat{\jmath} \\ \\ &+ \left( -2 \right) \hat{k} \end{aligned}$ Matching terms, our original constraint now becomes two specific requirements: $\begin{aligned} \dfrac{\partial P}{\partial y} &= 0 \\ \\ -\dfrac{\partial P}{\partial x} &= \cos(z) - x \end{aligned}$ One solution is $P = \dfrac{x^2}{2} - x\cos(z)$. There are infinitely many functions purely of $z$ that we could add on to this solution, but the problem asks us to leave out extraneous functions of $z$. Therefore, we can simplify the surface integral into the line integral below: $ \oint_C \left( (2y) \hat{\imath} + (2z^2) \hat{\jmath} + \left(\dfrac{x^2}{2} - x\cos(z) \right) \hat{k} \right) \cdot dr$